import java.util.*;

public class ListExcercise2 {
    public static void main(String[] args) {
        List a1 = new ArrayList();
        a1.add(new Book("红楼梦", "caoxueyin", 100));
        a1.add(new Book("西游记", "吴承恩", 10));
        a1.add(new Book("水浒传", "施耐庵", 9.20));
        a1.add(new Book("三国演", "罗贯中", 80));
        a1.add(new Book("格列佛", "外国人", 10));
        Iterator i = a1.iterator();
        while(i.hasNext()){
            System.out.println(i.next());
        }
        for(Object o:a1){
            System.out.println(o);
        }
    }
}
